import 'package:json_annotation/json_annotation.dart';
import 'package:my_flutter_github/model/Repository.dart';
import 'package:my_flutter_github/model/User.dart';
import 'package:my_flutter_github/model/UserEventPayload.dart';

part 'UserEvent.g.dart';

@JsonSerializable()
class UserEvent extends Object with _$UserEventSerializerMixin {
  String id;
  String type;
  User actor;
  Repository repo;
  User org;
  UserEventPayload payload;
  @JsonKey(name: "public")
  bool isPublic;
  @JsonKey(name: "created_at")
  DateTime createdAt;

  UserEvent(
      this.id,
      this.type,
      this.actor,
      this.repo,
      this.org,
      this.payload,
      this.isPublic,
      this.createdAt,
      );

  factory UserEvent.fromJson(Map<String, dynamic> json) => _$UserEventFromJson(json);
}